<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>添加邀请码</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="stylesheet" href="assets/layui/css/layui.css">
	<link rel="stylesheet" href="assets/css/all.css" />
</head>
<body class="add-new-account">
	<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
	<!--[if lt IE 9]>
		  <script src="assets/js/html5.min.js"></script>
		  <script src="assets/js/respond.min.js"></script>
		<![endif]-->
	<div class="layui-container">
		<div class="layui-text">
			<h2 class="layui-field-title" style="text-align: center;">请为邀请码分配权限</h2>
		</div>
		<form class="layui-form" action="" onsubmit="return false;">
			<div class="layui-form-item">
				<label class="layui-form-label">公司名称</label>
				<div class="layui-input-block">
					<input id="comName" type="text" name="" lay-verify="required|comName" autocomplete="off" class="layui-input">
				</div>
			</div>
		</form>
		<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
			<legend>权限：系统权限配置</legend>
		</fieldset>
		<ul id="qxlist" style="margin-left: 20px;"></ul>
		<div style="text-align: center;margin:20px auto;">
			<button class="layui-btn create-code" lay-submit lay-filter="create-code">生成</button>
		</div>
	</div>

	<script src="assets/layui/layui.js"></script>
	<script>
		layui.use(['tree','form','layer'], function() {
			var form = layui.form,
				layer = layui.layer,
				$ = layui.$
				
				
			//生成邀请码的页面addCode.html
		    $(".create-code").on("click",function(){
		    	layer.open({
					type: 2,
					title: '发送邀请码',
					area: ['550px', '320px'],
					content: 'sendCode.html'
				});
		    })
			var tree = layui.tree({
				elem: '#qxlist', //指定元素，生成的树放到哪个元素上
				check: 'checkbox', //勾选风格
				skin: 'as', //设定皮肤
				drag: true, //点击每一项时是否生成提示信息
				checkboxName: 'aa[]', //复选框的name属性值
				checkboxStyle: "", //设置复选框的样式，必须为字符串，css样式怎么写就怎么写
				click: function(item) { //点击节点回调
					console.log("item")
				},
				onchange: function() { //当当前input发生变化后所执行的回调
					console.log(this);
				},
				nodes: [ //节点
					{
						name: '管理系統', //节点名称
						spread: false, //是否是展开状态，true为展开状态						
						//href: "", //设置节点跳转的链接，如果不设置则不会跳转
						//target: "_self", //节点链接打开方式
						alias: 'changyong',
						data: { //为元素添加额外数据，即在元素上添加data-xxx="yyy"，可选
							nodeName: "管理系統",
							alias: "changyong"
						},
						checkboxValue: 1, //复选框的值
						checked: false, //复选框默认是否选中
						children: [{
							name: '人员管理',
							spread: false, //是否是展开状态，true为展开状态
							alias: 'renyuan',
							checked: false,
							checkboxValue: 2,
							children:[{
								name:'添加'
							},{
								name:'编辑/修改'
							},{
								name:'删除'
							}]
						}, {
							name: '系统统计',
							spread: false, //是否是展开状态，true为展开状态
							children:[{
								name:'查看'
							},{
								name:'导出'
							}]
						}, {
							name: '公告信息/编辑',
							checked: false,
							checkboxValue: 3
						}]
					}, {
						name: '询残系统',
						checked: false,
						spread: false,
						data: {
							nodeName: "询残系统",
							alias: "xuncan"
						},
						children: [{
							name: '发布车辆信息',
							checked: false,
							checkboxValue: 4,
							spread: false,
							children: [{
								name: '发布',
								checked: false,
								checkboxValue: 5,								
							}, {
								name: '提交审核',
								checked: false,
								checkboxValue: 9
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 10
							}]
						}, {
							name: '车辆管理',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 13
							}, {
								name: '确认更改',
								checked: false,
								checkboxValue: 14
							},{
								name:'查看报价清单'
							}]
						},{
							name: '订单管理',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '查看报价清单',
								checked: false,
								checkboxValue: 13
							}, {
								name: '编辑中标结果',
								checked: false,
								checkboxValue: 14
							},{
								name:'发布中标结果'
							}]
						},{
							name: '系统统计',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看',
								checked: false,
								checkboxValue: 12
							}, {
								name: '导出',
								checked: false,
								checkboxValue: 13
							}]
						}]
					},{
						name: '旧件拍卖系统',
						checked: false,
						spread: false,
						data: {
							nodeName: "旧件拍卖系统",
							alias: "jiujian"
						},
						children: [{
							name: '发布旧件信息',
							checked: false,
							checkboxValue: 4,
							spread: false,
							children: [{
								name: '发布',
								checked: false,
								checkboxValue: 5,								
							}, {
								name: '提交审核',
								checked: false,
								checkboxValue: 9
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 10
							}]
						}, {
							name: '旧件管理',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 13
							}, {
								name: '确认更改',
								checked: false,
								checkboxValue: 14
							},{
								name:'查看报价清单'
							}]
						},{
							name: '订单管理',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '查看报价清单',
								checked: false,
								checkboxValue: 13
							}, {
								name: '编辑中标结果',
								checked: false,
								checkboxValue: 14
							},{
								name:'发布中标结果'
							}]
						},{
							name: '系统统计',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看',
								checked: false,
								checkboxValue: 12
							}, {
								name: '导出',
								checked: false,
								checkboxValue: 13
							}]
						}]
					},{
						name: '送修系统',
						checked: false,
						spread: false,
						data: {
							nodeName: "送修系统",
							alias: "songxiu"
						},
						children: [{
							name: '发布车辆信息',
							checked: false,
							checkboxValue: 4,
							spread: false,
							children: [{
								name: '发布',
								checked: false,
								checkboxValue: 5,								
							}, {
								name: '提交审核',
								checked: false,
								checkboxValue: 9
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 10
							}]
						}, {
							name: '车辆管理',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 13
							}, {
								name: '确认更改',
								checked: false,
								checkboxValue: 14
							},{
								name:'查看报价清单'
							}]
						},{
							name: '订单管理',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '查看报价清单',
								checked: false,
								checkboxValue: 13
							}, {
								name: '编辑中标结果',
								checked: false,
								checkboxValue: 14
							},{
								name:'发布中标结果'
							}]
						},{
							name: '已修复清单',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '查看报价清单',
								checked: false,
								checkboxValue: 13
							}, {
								name: '查看修复结果',
								checked: false,
								checkboxValue: 14
							}]
						},{
							name: '系统统计',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看',
								checked: false,
								checkboxValue: 12
							}, {
								name: '导出',
								checked: false,
								checkboxValue: 13
							}]
						}]
					},{
						name: '旧件修复系统',
						checked: false,
						spread: false,
						data: {
							nodeName: "旧件修复系统",
							alias: "jiujianxiufu"
						},
						children: [{
							name: '发布旧件信息',
							checked: false,
							checkboxValue: 4,
							spread: false,
							children: [{
								name: '发布',
								checked: false,
								checkboxValue: 5,								
							}, {
								name: '提交审核',
								checked: false,
								checkboxValue: 9
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 10
							}]
						}, {
							name: '旧件管理',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 13
							}, {
								name: '确认更改',
								checked: false,
								checkboxValue: 14
							},{
								name:'查看报价清单'
							}]
						},{
							name: '订单管理',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '查看报价清单',
								checked: false,
								checkboxValue: 13
							}, {
								name: '编辑中标结果',
								checked: false,
								checkboxValue: 14
							},{
								name:'发布中标结果'
							}]
						},{
							name: '已修复清单',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '查看报价清单',
								checked: false,
								checkboxValue: 13
							}, {
								name: '查看修复结果',
								checked: false,
								checkboxValue: 14
							}]
						},{
							name: '系统统计',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看',
								checked: false,
								checkboxValue: 12
							}, {
								name: '导出',
								checked: false,
								checkboxValue: 13
							}]
						}]
					},{
						name: '调查系统',
						checked: false,
						spread: false,
						data: {
							nodeName: "调查系统",
							alias: "diaocha"
						},
						children: [{
							name: '指派车辆信息',
							checked: false,
							checkboxValue: 4,
							spread: false,
							children: [{
								name: '指派',
								checked: false,
								checkboxValue: 5,								
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 9
							}]
						}, {
							name: '车辆管理',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 13
							}, {
								name: '确认更改',
								checked: false,
								checkboxValue: 14
							},{
								name:'查看调查结果'
							}]
						},{
							name: '系统统计',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看',
								checked: false,
								checkboxValue: 12
							}, {
								name: '导出',
								checked: false,
								checkboxValue: 13
							}]
						}]
					},{
						name: '救援系统',
						checked: false,
						spread: false,
						data: {
							nodeName: "救援系统",
							alias: "jiuyuan"
						},
						children: [{
							name: '编辑车辆信息',
							checked: false,
							checkboxValue: 4,
							spread: false,
							children: [{
								name: '指派',
								checked: false,
								checkboxValue: 5,								
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 9
							}]
						}, {
							name: '车辆管理',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 13
							}, {
								name: '确认更改',
								checked: false,
								checkboxValue: 14
							},{
								name:'查看调查结果'
							}]
						},{
							name: '系统统计',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看',
								checked: false,
								checkboxValue: 12
							}, {
								name: '导出',
								checked: false,
								checkboxValue: 13
							}]
						}]
					},{
						name: '追偿系统',
						checked: false,
						spread: false,
						data: {
							nodeName: "追偿系统",
							alias: "zhuichang"
						},
						children: [{
							name: '编辑车辆信息',
							checked: false,
							checkboxValue: 4,
							spread: false,
							children: [{
								name: '指派',
								checked: false,
								checkboxValue: 5,								
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 9
							}]
						}, {
							name: '车辆管理',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看详情',
								checked: false,
								checkboxValue: 12
							}, {
								name: '编辑',
								checked: false,
								checkboxValue: 13
							}, {
								name: '确认更改',
								checked: false,
								checkboxValue: 14
							},{
								name:'查看追偿结果'
							}]
						},{
							name: '系统统计',
							checked: false,
							checkboxValue: 11,
							children: [{
								name: '查看',
								checked: false,
								checkboxValue: 12
							}, {
								name: '导出',
								checked: false,
								checkboxValue: 13
							}]
						}]
					}
				]
			});	
		});
	</script>
</body>
</html>
